﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminFunction.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="BitPortal.Admin.Config.UserConfig.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData" GroupField="Group">
        <Reader>
            <ext:JsonReader IDProperty="Name">
                <Fields>
                    <ext:RecordField Name="Name" Type="String" />
                    <ext:RecordField Name="Group" Type="String" />
                    <ext:RecordField Name="Description" Type="String" />
                    <ext:RecordField Name="Value" Type="Auto" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <SortInfo Field="Name" Direction="ASC" />
    </ext:Store>
    <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true" Title="Danh sách cấu hình"
        StoreID="Store1">
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column Header="Key" DataIndex="Name" Groupable="false" Hidden="true" />
                <ext:Column Header="Cấu hình" DataIndex="Description" Groupable="false"  Width="250" />
                <ext:Column Header="Nhóm" DataIndex="Group" />
                <ext:Column Header="Giá trị" DataIndex="Value" Groupable="false" />
                <ext:ImageCommandColumn Header="Sửa" Align="Center" Width="40" Fixed="true">
                    <Commands>
                        <ext:ImageCommand CommandName="MyCommand" Icon="Pencil" ToolTip-Text="Sửa">
                        </ext:ImageCommand>
                    </Commands>
                </ext:ImageCommandColumn>
            </Columns>
        </ColumnModel>
        <Listeners>
            <Command Handler="Ext.net.DirectMethods.EditConfig(record.data.Name);" />
        </Listeners>
        <SelectionModel>
            <ext:RowSelectionModel runat="server">
            </ext:RowSelectionModel>
        </SelectionModel>
        <View>
            <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" MarkDirty="false"
                ShowGroupName="false" EnableNoGroups="true" HideGroupedColumn="true" ShowGroupsText="Nhóm lại theo cột này"
                StartCollapsed="true" />
        </View>
        <LoadMask ShowMask="true" />
        <Plugins>
            <ext:GridFilters runat="server" ID="GridFilters1">
                <Filters>
                    <ext:StringFilter DataIndex="Description" />
                    <ext:StringFilter DataIndex="Name" />
                </Filters>
            </ext:GridFilters>
        </Plugins>
    </ext:GridPanel>
    <uc:UserConfig ID="UserConfig1" runat="server" />
</asp:Content>
